package com.hycreate.platform.modules.product;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.hycreate.platform.common.persistence.Page;
import com.hycreate.platform.common.service.CrudService;
import com.hycreate.platform.common.utils.mypage.PageDemo;
import com.hycreate.platform.modules.atta.SfAttachment;
import com.hycreate.platform.modules.element.SfElement;
import com.hycreate.platform.modules.project.SfProject;
import com.hycreate.platform.modules.project.product.SfProjectProduct;

/**
 * 产品Service
 * @author hoader
 * @version 2017-01-09
 */
@Service
@Transactional(readOnly = true)
public class SfProductService extends CrudService<SfProductDao, SfProduct> {

	public SfProduct get(String id) {
		return super.get(id);
	}
	
	public List<SfProduct> findList(SfProduct sfProduct) {
		return super.findList(sfProduct);
	}
	
	public Page<SfProduct> findPage(Page<SfProduct> page, SfProduct sfProduct) {
		return super.findPage(page, sfProduct);
	}
	
	@Transactional(readOnly = false)
	public void save(SfProduct sfProduct) {
		super.save(sfProduct);
	}
	
	@Transactional(readOnly = false)
	public void delete(SfProduct sfProduct) {
		super.delete(sfProduct);
	}
	
	
	public List<SfElement>  findElement(PageDemo pd){
		return dao.findElement(pd);
	}
	
	public int  elementCount(String id){
		return dao.elementCount(id);
	}
	
	public List<SfProduct> findImportList (SfProduct sfProudct){
		
		return dao.findImportList(sfProudct);
	}
	
    public SfProduct getproduct(String code){
		
		return dao.getproduct(code);
	}
	
    public List<SfAttachment> findProductPic(String id ){
    	return dao.findProductPic(id);
    }
    
    @Transactional(readOnly = false)
    public void batchDeletes(List delList){
    	
    	dao.batchDeletes(delList);
    }
    
    public List<SfProduct> findPageList(PageDemo pd){
    	
    	return dao.findPageList(pd);
    }
    
    public int productCount(SfProduct sfProduct){
    	
    	return dao.productCount(sfProduct);
    }
    
   public List<SfProduct> ProductEntityPage(PageDemo pd){
		
		return dao.ProductEntityPage(pd);
	}
   
   public int  ProductEntityCount(String pid){
	   
	   return dao.ProductEntityCount(pid);
   }
   
   @Transactional(readOnly = false)
   public void DeletesRedundancy(List delList){
	   
	   dao.DeletesRedundancy(delList);
   }
   
   
   public List<SfProjectProduct> DELLIST(){
	   
	   return dao.DELLIST();
   }
   
   @Transactional(readOnly = false)
   public void DeletesRedundancyProduct(List delList){
	   
	   dao.DeletesRedundancyProduct(delList);
   }
   public SfProduct codeFindProduct(String code){
	   return dao.codeFindProduct(code);
   }
   
}